commonlibsse_ng\re\b/
BShkbAnimationGraph.rs

1//! # BShkbAnimationGraph
2//!
3//! Represents an animation graph with ragdoll control and event handling.
4//!
5//! Inherits from:
6//! - `BSIRagdollDriver`
7//! - `BSIntrusiveRefCounted`
8//! - `BSTEventSource<BSTransformDeltaEvent>`
9//! - `BSTEventSource<BSAnimationGraphEvent>`
10//!
11//! # Memory Layout:
12//! - `character_instance`: The character instance (0xC0)
13//! - `bone_nodes`: Array of bone node entries (0x160)
14//! - `fade_controllers`: Array of float controllers (0x178)
15//! - `project_name`: Name of the project (0x1F0)
16//! - `physics_world`: Physics world reference (0x238)
17
18use crate::re::Actor::Actor;
19use crate::re::BSAnimationGraphEvent::BSAnimationGraphEvent;
20use crate::re::BSFixedString::BSFixedString;
21use crate::re::BSIRagdollDriver::BSIRagdollDriver;
22use crate::re::BSIntrusiveRefCounted::BSIntrusiveRefCounted;
23use crate::re::BSIntrusiveRefCounted::BSIntrusiveRefCountedTrait;
24use crate::re::BSResource::ID;
25use crate::re::BSTArray::BSTArray;
26use crate::re::BSTEvent::BSTEventSource;
27use crate::re::BSTransformDeltaEvent;
28use crate::re::BShkFloatController::BShkFloatController;
29use crate::re::bhkWorld::bhkWorld;
30use crate::re::hkbBehaviorGraph::hkbBehaviorGraph;
31use crate::re::hkbCharacter::hkbCharacter;
32use crate::re::hkbGeneratorOutput::hkbGeneratorOutput;
33use crate::re::{BSFadeNode, NiNode};
34
35#[repr(C)]
36#[derive(Debug)]
37pub struct BoneNodeEntry {
38    /// Pointer to the node
39    pub node: *mut NiNode, // 0x00
40
41    /// Unknown field
42    pub unk08: u32, // 0x08
43
44    /// Unknown field
45    pub unk0C: u32, // 0x0C
46}
47
48#[repr(C)]
49#[derive(Debug)]
50pub struct BShkbAnimationGraph {
51    /// Base classes
52    pub __base: BSIRagdollDriver, // 0x000
53    pub __base1: BSIntrusiveRefCounted,                 // 0x008
54    pub __base2: BSTEventSource<BSTransformDeltaEvent>, // 0x010
55    pub __base3: BSTEventSource<BSAnimationGraphEvent>, // 0x068
56
57    /// Members
58    pub character_instance: hkbCharacter, // 0x0C0
59    pub bone_nodes: BSTArray<BoneNodeEntry>, // 0x160
60    pub fade_controllers: BSTArray<*mut BShkFloatController>, // 0x178
61    pub unk190: BSTArray<*mut core::ffi::c_void>, // 0x190
62    pub unk1A8: BSTArray<*mut core::ffi::c_void>, // 0x1A8
63    pub unk1C0: BSTArray<u8>,                // 0x1C0
64    pub unk1D8: u64,                         // 0x1D8
65    pub unk1E0: u64,                         // 0x1E0
66    pub interpolation_time_offsets: [f32; 2], // 0x1E8
67    pub project_name: BSFixedString,         // 0x1F0
68    pub project_db_data: *mut ID,            // 0x1F8
69    pub project_data: *mut core::ffi::c_void, // 0x200
70    pub behavior_graph: *mut hkbBehaviorGraph, // 0x208
71    pub holder: *mut Actor,                  // 0x210
72    pub root_node: *mut BSFadeNode,          // 0x218
73    pub generator_outputs: [*mut hkbGeneratorOutput; 2], // 0x220
74    pub interpolation_amounts: [f32; 2],     // 0x230
75    pub physics_world: *mut bhkWorld,        // 0x238
76    pub num_anim_bones: u16,                 // 0x240
77    pub unk242: u8,                          // 0x242
78    pub unk243: u8,                          // 0x243
79    pub unk244: u16,                         // 0x244
80    pub unk246: u8,                          // 0x246
81    pub unk247: u8,                          // 0x247
82    pub unk248: u8,                          // 0x248
83    pub do_foot_ik: u8,                      // 0x249
84    pub unk24A: u16,                         // 0x24A
85    pub unk24C: u32,                         // 0x24C
86}
87
88const _: () = {
89    assert!(core::mem::size_of::<BShkbAnimationGraph>() == 0x250);
90};
91
92impl BSIntrusiveRefCountedTrait for BShkbAnimationGraph {
93    #[inline]
94    fn inc_ref(&self) -> u32 {
95        self.__base1.inc_ref()
96    }
97
98    #[inline]
99    fn dec_ref(&self) -> u32 {
100        self.__base1.dec_ref()
101    }
102}
103
104impl BShkbAnimationGraph {
105    /// Gets a boolean graph variable.
106    #[commonlibsse_ng_derive_internal::relocate_fn(se_id = 62696, ae_id = 63613)]
107    pub fn get_graph_variable_bool(&self, variable_name: &BSFixedString, out: &mut bool) -> bool {}
108
109    /// Gets a float graph variable.
110    #[commonlibsse_ng_derive_internal::relocate_fn(se_id = 62695, ae_id = 63614)]
111    pub fn get_graph_variable_float(&self, variable_name: &BSFixedString, out: &mut f32) -> bool {}
112
113    /// Gets an integer graph variable.
114    #[commonlibsse_ng_derive_internal::relocate_fn(se_id = 62694, ae_id = 63615)]
115    pub fn get_graph_variable_int(&self, variable_name: &BSFixedString, out: &mut i32) -> bool {}
116
117    /// Sets a boolean graph variable.
118    #[commonlibsse_ng_derive_internal::relocate_fn(se_id = 63609, ae_id = 62708)]
119    pub fn set_graph_variable_bool(&mut self, variable_name: &BSFixedString, value: bool) -> bool {}
120
121    /// Sets a float graph variable.
122    #[commonlibsse_ng_derive_internal::relocate_fn(se_id = 63608, ae_id = 62709)]
123    pub fn set_graph_variable_float(&mut self, variable_name: &BSFixedString, value: f32) -> bool {}
124
125    /// Sets an integer graph variable.
126    #[commonlibsse_ng_derive_internal::relocate_fn(se_id = 63607, ae_id = 62710)]
127    pub fn set_graph_variable_int(&mut self, variable_name: &BSFixedString, value: i32) -> bool {}
128}